import java.util.Arrays;

public class ArraysMethodTest
{
    public static void main(String[] args) {
        int [] arr ={0,1,2,3,4,5,6,7};

        System.out.println(Arrays.binarySearch(arr, 7));
        System.out.println(Arrays.binarySearch(arr, 2, 8, 2));
    }
}
